<?php
use Illuminate\Http\Request;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::any('login', 'Admin\LoginController@index');

Route::group(['middleware' =>'throttle:5 1'],function (){
    Route::post('login_do', 'Admin\LoginController@login_do');
});

Route::get('session_time', 'Admin\LoginController@session_time');

Route::group(['middleware' =>['admin', 'adminLog']],function (){
    Route::get('/', 'Admin\IndexController@index');
    Route::get('index','Admin\IndexController@index');
    Route::get('home','Admin\IndexController@home');
    Route::get('login_up', 'Admin\LoginController@login_up');

    Route::get('member_edit','Admin\LoginController@member_edit');
    Route::post('update_password','Admin\LoginController@login_edit_pwd');

    //門店
    Route::get('store', 'Admin\StoreController@index');
    Route::get('store_edit/{id}', 'Admin\StoreController@edit');
    Route::get('store_add', 'Admin\StoreController@add');
    Route::post('store_do', 'Admin\StoreController@do');

    //课程
    Route::get('class_base', 'Admin\ClassBaseController@index');
    Route::get('class_edit/{id}', 'Admin\ClassBaseController@edit');
    Route::get('class_add', 'Admin\ClassBaseController@add');
    Route::post('class_do', 'Admin\ClassBaseController@do');

    //课程編號
    Route::get('class_numbering', 'Admin\ClassBaseNumberingController@index');
    Route::get('class_numbering_edit/{id}', 'Admin\ClassBaseNumberingController@edit');
    Route::get('class_numbering_add', 'Admin\ClassBaseNumberingController@add');
    Route::post('class_numbering_do', 'Admin\ClassBaseNumberingController@do');
    Route::post('class_numbering_del/{id}', 'Admin\ClassBaseNumberingController@del');

    //老师
    Route::get('teacher', 'Admin\TeacherControler@index');
    Route::get('teacher_edit/{id}', 'Admin\TeacherControler@edit');
    Route::post('teacher_del/{id}', 'Admin\TeacherControler@del');
    Route::get('teacher_add', 'Admin\TeacherControler@add');
    Route::post('teacher_do', 'Admin\TeacherControler@do');

    //时间
    Route::get('time', 'Admin\ClassBaseTimeController@index');
    Route::get('time_edit/{id}', 'Admin\ClassBaseTimeController@edit');
    Route::get('time_add', 'Admin\ClassBaseTimeController@add');
    Route::post('time_do', 'Admin\ClassBaseTimeController@do');

    //課室
    Route::get('classroom', 'Admin\ClassroomController@index');
    Route::get('classroom_edit/{id}', 'Admin\ClassroomController@edit');
    Route::get('classroom_add', 'Admin\ClassroomController@add');
    Route::post('classroom_do', 'Admin\ClassroomController@do');

    //上课季度
    Route::get('quarterly', 'Admin\QuarterlyController@index');
    Route::get('quarterly_add', 'Admin\QuarterlyController@add');
    Route::post('quarterly_do', 'Admin\QuarterlyController@do');
    Route::post('quarterly_del/{id}', 'Admin\QuarterlyController@del');

    //輪播圖
    Route::get('carousel_image/{type_id}/{type}', 'Admin\CarouselImageController@index');
    Route::get('carousel_image_edit/{id}/{type_id}/{type}', 'Admin\CarouselImageController@edit');
    Route::get('carousel_image_add/{type_id}/{type}', 'Admin\CarouselImageController@add');
    Route::any('carousel_image_del/{id}', 'Admin\CarouselImageController@del');
    Route::post('carousel_image_do', 'Admin\CarouselImageController@do');

    //安排列表
    Route::get('class_sign_code/{id}/{time}', 'Admin\ReservationController@sign_code');
    Route::get('class_sign_lists/{id}/{time}', 'Admin\ReservationController@sign_lists');
    Route::post('class_sign_in/{id}', 'Admin\UserSubscribeController@sign_in');
    Route::get('class_base_info', 'Admin\ReservationController@index');
    Route::any('class_base_info_edit_level', 'Admin\ReservationController@class_base_info_edit_level');
    Route::get('class_base_info_teacher/{id}', 'Admin\ReservationController@class_base_info_teacher');
    Route::get('class_base_info_teacher_add/{id}', 'Admin\ReservationController@class_base_info_teacher_add');
    Route::any('class_base_info_teacher_del/{id}/{teacher_id}', 'Admin\ReservationController@class_base_info_teacher_del');
    Route::any('class_base_info_teacher_do', 'Admin\ReservationController@class_base_info_teacher_do');
    Route::get('class_base_info_planned/{day}', 'Admin\ReservationController@home_lists');
    Route::get('class_base_info_add', 'Admin\ReservationController@add');
    Route::get('class_base_info_add_home/{class_classroom_id}/{time}', 'Admin\ReservationController@home_add');
    Route::get('class_base_info_edit_home/{class_classroom_id}/{time}/{id}', 'Admin\ReservationController@home_edit');
    Route::post('class_base_info_do', 'Admin\ReservationController@do');
    Route::post('class_base_info_del/{id}', 'Admin\ReservationController@del');

    //报告
    Route::get('report', 'Admin\ReportController@index');

    //联动查询
    Route::post('class_base_teacher', 'Admin\CommonController@base_teacher_classroom');
    Route::post('class_base_time', 'Admin\CommonController@class_base_time');

    //用戶充值
    Route::get('user_integral', 'Admin\UserIntegralController@index');
    Route::get('user_integral_edit/{id}', 'Admin\UserIntegralController@edit');
    Route::get('user_integral_add', 'Admin\UserIntegralController@add');
    Route::post('user_integral_do', 'Admin\UserIntegralController@do');

    //banner
    Route::get('banner', 'Admin\BannerController@index');
    Route::get('banner_edit/{id}', 'Admin\BannerController@edit');
    Route::post('banner_del/{id}', 'Admin\BannerController@del');
    Route::get('banner_add', 'Admin\BannerController@add');
    Route::post('banner_do', 'Admin\BannerController@do');

    //camp
    Route::get('camp', 'Admin\GroupClassController@index');
    Route::get('camp_edit/{id}', 'Admin\GroupClassController@edit');
    Route::post('camp_del/{id}', 'Admin\GroupClassController@del');
    Route::get('camp_info/{id}', 'Admin\GroupClassController@camp_info');
    Route::get('camp_add', 'Admin\GroupClassController@add');
    Route::post('camp_do', 'Admin\GroupClassController@do');
    Route::post('camp_reservation_lists', 'Admin\GroupClassController@reservation_lists');

    //优惠套餐
    Route::get('binding', 'Admin\BindingController@index');
    Route::get('binding_edit/{id}', 'Admin\BindingController@edit');
    Route::post('binding_del/{id}', 'Admin\BindingController@del');
    Route::get('binding_add', 'Admin\BindingController@add');
    Route::post('binding_do', 'Admin\BindingController@do');
    Route::get('binding_exchange/{id}', 'Admin\BindingController@binding_exchange');

    //套餐表
    Route::get('integral_plan', 'Admin\IntegralPlanController@index');
    Route::get('integral_plan_edit/{id}', 'Admin\IntegralPlanController@edit');
    Route::get('integral_plan_add', 'Admin\IntegralPlanController@add');
    Route::post('integral_plan_do', 'Admin\IntegralPlanController@do');
    Route::post('integral_plan_del/{id}', 'Admin\IntegralPlanController@del');

    //积分商城
    Route::get('goods', 'Admin\GoodsController@index');
    Route::get('goods_edit/{id}', 'Admin\GoodsController@edit');
    Route::get('goods_add', 'Admin\GoodsController@add');
    Route::post('goods_do', 'Admin\GoodsController@do');
    Route::post('goods_del/{id}', 'Admin\GoodsController@del');

    //积分商城订单列表
    Route::get('order', 'Admin\OrderController@index');
    Route::any('order_edit/{id}', 'Admin\OrderController@edit');

    //付款方式
    Route::get('pay_type', 'Admin\PayTypeController@index');
    Route::get('pay_type_edit/{id}', 'Admin\PayTypeController@edit');
    Route::get('pay_type_add', 'Admin\PayTypeController@add');
    Route::post('pay_type_do', 'Admin\PayTypeController@do');
    Route::post('pay_type_del/{id}', 'Admin\PayTypeController@del');

    //规则设置
    Route::any('rule', 'Admin\RuleController@index');
    Route::any('rule_edit', 'Admin\RuleController@edit');
    Route::any('rule_pints_cleared', 'Admin\RuleController@rule_pints_cleared');

    //接收参数
    Route::post('home', 'Admin\IndexController@home');

    //用户列表
    Route::get('user_lists', 'Admin\UserController@index');
    Route::get('user_edit/{id}', 'Admin\UserController@edit');
    Route::any('points_record/{id}', 'Admin\UserController@points_record');
    Route::any('record_edit/{id}', 'Admin\UserController@record_edit');
    Route::any('record_do', 'Admin\UserController@record_do');
    Route::any('user_do', 'Admin\UserController@do');
    Route::any('user_update_expire_time', 'Admin\UserController@update_expire_time');
    Route::any('user_update_vip_expire_time', 'Admin\UserController@user_update_vip_expire_time');
    Route::any('user_update_vip_activate_time', 'Admin\UserController@user_update_vip_activate_time');
    Route::any('points_record', 'Admin\UserController@points_record');
    Route::any('user_vip/{id}', 'Admin\UserController@vip');
    Route::any('user_vip', 'Admin\UserController@vip');
    Route::get('user_vip_info/{user_id}/{vip_id}', 'Admin\UserController@vip_info');
    Route::get('user_vip_use_info/{user_id}/{vip_id}', 'Admin\UserController@vip_use_info');
    Route::any('user_vip_del/{user_id}/{vip_id}', 'Admin\UserController@vip_del');
    Route::any('edit_rank', 'Admin\UserController@edit_rank');
    Route::any('user_import', 'Admin\UserController@user_import');
    Route::any('user_vip_do', 'Admin\UserController@vip_do');

    Route::get('user_subscribe', 'Admin\UserSubscribeController@index');
    Route::any('user_return_queue/{id}', 'Admin\UserSubscribeController@return_queue');
    Route::any('cancel_appointment/{id}', 'Admin\UserSubscribeController@cancel_appointment');
    Route::get('home_index/{class_base_info_id}/{time}', 'Admin\UserSubscribeController@home_index');

    //预约用户列表
    Route::get('home_reservation_lists/{class_base_info_id}/{time}/{is_camp}', 'Admin\ReservationController@home_reservation_lists');
    Route::any('home_reservation_do/{class_base_info_id}/{time}/{user_id}/{camp}', 'Admin\ReservationController@home_reservation_do');

    //权限列表
    Route::get('admin_li','Admin\AdminController@li');
    Route::get('edit/{id}','Admin\AdminController@edit');
    Route::post('edit_do','Admin\AdminController@add');
    Route::post('admin_del/{id}','Admin\AdminController@del');
    Route::get('add','Admin\AdminController@admin_add');

    Route::post('ban/{id}','Admin\AdminController@ban');

    Route::get('right_list','Admin\AdminController@right_list');
    Route::get('admin_add_right','Admin\AdminController@admin_add_right');
    Route::get('admin_edit_right/{id}','Admin\AdminController@admin_edit_right');
    Route::get('ajax_get_action','Admin\AdminController@ajax_get_action');
    Route::post('edit_right_do','Admin\AdminController@edit_right_do');
    Route::get('right_del/{id}','Admin\AdminController@right_del');

    //角色
    Route::get('role','Admin\AdminController@role');
    Route::get('add_role','Admin\AdminController@add_role');
    Route::get('role_del/{id}','Admin\AdminController@roleDel');
    Route::get('role_edit/{id}','Admin\AdminController@role_info');
    Route::post('add_role_do','Admin\AdminController@roleSave');
    Route::get('power','Admin\AdminController@power');
    Route::POST('powerDelete/{id}','Admin\AdminController@powerDelete');
    Route::POST('powerDeleteAll','Admin\AdminController@powerDeleteAll');
    Route::get('power/{id}','Admin\AdminController@powerInfo');
    //权限列表

    //等级设置
    Route::get('level','Admin\LevelController@index');
    Route::get('level_edit/{id}', 'Admin\LevelController@edit');
    Route::post('level_del/{id}', 'Admin\LevelController@del');
    Route::get('level_add', 'Admin\LevelController@add');
    Route::post('level_do', 'Admin\LevelController@do');

    //优惠卷
    Route::get('coupon', 'Admin\GouponController@index');
    Route::get('coupon_edit/{id}', 'Admin\GouponController@edit');
    Route::post('coupon_del/{id}', 'Admin\GouponController@del');
    Route::get('coupon_add', 'Admin\GouponController@add');
    Route::post('coupon_do', 'Admin\GouponController@do');
    Route::get('recipients/{id}', 'Admin\GouponController@recipients');

    //vip
    Route::get('vip', 'Admin\VipController@index');
    Route::get('vip_edit/{id}', 'Admin\VipController@edit');
    Route::post('vip_del/{id}', 'Admin\VipController@del');
    Route::get('vip_add', 'Admin\VipController@add');
    Route::post('vip_do', 'Admin\VipController@do');
    Route::post('vip_search', 'Admin\VipController@search');

    //用户经验值
    Route::get('user_rank_exp','Admin\UserRankExpController@index');

    //更新环境数据跑数据
    Route::any('system_index', 'Admin\SystemController@index');
    Route::any('system_do', 'Admin\SystemController@do');
    Route::any('system_message', 'Admin\SystemController@system_message');
});

